---
title: 
- "Replication package for Karreth, Passmore & Tir (FPA)"
subtitle:
- "The Role of Foreign Aid in Procuring Civil War Party Consent to Peacekeeping"
author: 
- Johannes Karreth
- Timothy Passmore
- Jaroslav Tir

date: 
- January 7, 2024

output:
  rmdformats::readthedown:
    highlight: default
    smart: false
---

This folder contains all data and code to reproduce the analyses in:

> Karreth, Johannes, Timothy Passmore, and Jaroslav Tir. Forthcoming. The Role of Foreign Aid in Procuring Civil War Party Consent to Peacekeeping." *Foreign Policy Analysis*. [doi:10.1093/...](https://doi.org/10.1093...)

This document makes reference to the supporting information (SI), which is part of this replication package and also posted at <https://www.jkarreth.net>. For any questions, please contact the corresponding author at <jkarreth@ursinus.edu>.

To reproduce the analyses presented in the article, please open and run the script `analysis.R`. All objects created during the analysis, including all MCMC output from Bayesian estimation, is stored in the file `final_workspace.RData`. 

# Software requirements

Please install R (version 4.3.2 or higher). A list of R packages used in this project is at the end of this file. 

# Data sources

All data used in the analyses are provided in the two files `unre_1990_ch7_dat.csv` and `unre_1990_noch7_dat.csv`. Data sources are discussed and cited in the article and supporting information. **Please note that all variables from external sources are provided for replication purposes only. Use the original source to obtain the newest and authoritative version of each dataset.**

# Analysis 

The script `analysis.R` performs the following tasks:

- load the data for analysis
- conducting the analyses in the article and supporting information (`KPT_SI.pdf`)

This script creates the following tables and figures:

- Table 1
- Table 2
- All tables and figures in the supporting information

All tables and figures produced by these scripts are written to a folder named "Output", which is in the replication package but empty until the script is run. 

# Software version information

All analyses using R were executed on version 4.3.2; a list of packages and versions used is at the end of this file. 

```
R version 4.3.2 (2023-10-31)
Platform: aarch64-apple-darwin20 (64-bit)
Running under: macOS Ventura 13.6.2

Matrix products: default
BLAS:   /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib 
LAPACK: /Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/lib/libRlapack.dylib;  LAPACK version 3.11.0

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

time zone: America/New_York
tzcode source: internal

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
 [1] xtable_1.8-4       modelsummary_1.4.0 texreg_1.38.6      patchwork_1.1.2    gridExtra_2.3     
 [6] BayesPostEst_0.3.2 rstanarm_2.21.4    Rcpp_1.0.11        broom_1.0.4        lubridate_1.9.2   
[11] forcats_1.0.0      stringr_1.5.0      dplyr_1.1.2        purrr_1.0.2        readr_2.1.4       
[16] tidyr_1.3.0        tibble_3.2.1       ggplot2_3.4.4      tidyverse_2.0.0    rio_0.5.29        

loaded via a namespace (and not attached):
  [1] shinythemes_1.2.0       splines_4.3.2           later_1.3.1             bitops_1.0-7           
  [5] cellranger_1.1.0        datawizard_0.7.1        xts_0.13.1              lifecycle_1.0.3        
  [9] StanHeaders_2.26.27     globals_0.16.2          processx_3.8.1          lattice_0.21-9         
 [13] MASS_7.3-60             insight_0.19.1          crosstalk_1.2.0         backports_1.4.1        
 [17] magrittr_2.0.3          openxlsx_4.2.5.2        rmarkdown_2.25          yaml_2.3.7             
 [21] httpuv_1.6.11           zip_2.3.0               askpass_1.1             pkgbuild_1.4.0         
 [25] minqa_1.2.5             rvest_1.0.3             sandwich_3.0-2          gdtools_0.3.3          
 [29] inline_0.3.19           listenv_0.9.0           crul_1.3                performance_0.10.3     
 [33] parallelly_1.35.0       svglite_2.1.1           codetools_0.2-19        DT_0.27                
 [37] xml2_1.3.4              tidyselect_1.2.0        farver_2.1.1            bayesplot_1.10.0       
 [41] httpcode_0.3.0          lme4_1.1-33             effectsize_0.8.3        matrixStats_0.63.0     
 [45] stats4_4.3.2            base64enc_0.1-3         webshot_0.5.4           jsonlite_1.8.7         
 [49] ellipsis_0.3.2          emmeans_1.8.6           ggridges_0.5.4          survival_3.5-7         
 [53] systemfonts_1.0.4       tools_4.3.2             ragg_1.2.5              glue_1.6.2             
 [57] xfun_0.41               loo_2.6.0               withr_2.5.2             fastmap_1.1.1          
 [61] boot_1.3-28.1           fansi_1.0.5             shinyjs_2.1.0           openssl_2.0.6          
 [65] callr_3.7.3             caTools_1.18.2          digest_0.6.33           estimability_1.4.1     
 [69] timechange_0.2.0        R6_2.5.1                mime_0.12               textshaping_0.3.6      
 [73] colorspace_2.1-0        gtools_3.9.4            markdown_1.7            threejs_0.3.3          
 [77] utf8_1.2.4              generics_0.1.3          fontLiberation_0.1.0    data.table_1.14.8      
 [81] prettyunits_1.1.1       httr_1.4.6              htmlwidgets_1.6.2       parameters_0.21.0      
 [85] pkgconfig_2.0.3         dygraphs_1.1.1.6        gtable_0.3.4            lmtest_0.9-40          
 [89] htmltools_0.5.6.1       fontBitstreamVera_0.1.1 scales_1.2.1            kableExtra_1.3.4       
 [93] knitr_1.45              rstudioapi_0.14         tzdb_0.4.0              reshape2_1.4.4         
 [97] uuid_1.1-0              coda_0.19-4             checkmate_2.2.0         nlme_3.1-163           
[101] curl_5.0.0              nloptr_2.0.3            zoo_1.8-12              flextable_0.9.1        
[105] parallel_4.3.2          miniUI_0.1.1.1          foreign_0.8-85          pillar_1.9.0           
[109] grid_4.3.2              vctrs_0.6.4             shinystan_2.6.0         promises_1.2.0.1       
[113] evaluate_0.23           mvtnorm_1.1-3           cli_3.6.1               compiler_4.3.2         
[117] rlang_1.1.1             crayon_1.5.2            rstantools_2.3.1        future.apply_1.11.0    
[121] labeling_0.4.3          ps_1.7.5                plyr_1.8.8              runjags_2.2.1-7        
[125] stringi_1.7.12          rstan_2.26.22           viridisLite_0.4.2       tables_0.9.17          
[129] munsell_0.5.0           colourpicker_1.2.0      bayestestR_0.13.1       V8_4.3.0               
[133] fontquiver_0.2.1        Matrix_1.6-1.1          hms_1.1.3               future_1.32.0          
[137] gfonts_0.2.0            shiny_1.7.4             haven_2.5.2             ROCR_1.0-11            
[141] igraph_1.4.2            gt_0.9.0                RcppParallel_5.1.7      readxl_1.4.2           
[145] officer_0.6.2     
```
